//
//  FruitCollectionViewCell.m
//  FruitHelper
//
//  Created by 赵隆杰 on 2021/12/10.
//

#import "FruitCollectionViewCell.h"

@interface FruitCollectionViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *cellImage;
@property (weak, nonatomic) IBOutlet UILabel *cellTitle;


@end

@implementation FruitCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.contentView.backgroundColor = kLineColor;
    self.contentView.layer.cornerRadius = 5;
    self.contentView.layer.masksToBounds = YES;
    
    self.cellImage.layer.cornerRadius = 5;
    self.cellImage.layer.masksToBounds = YES;
}

- (void)setModel:(FruitModel *)model
{
    if (model.imageType == 1) {
        UIImage *image = [NSObject Base64StrToUIImage:model.imageStr];
        self.cellImage.image = image;
    } else {
        self.cellImage.image = [UIImage imageNamed:model.imageStr];
    }
    self.cellTitle.text = model.title;
}

@end
